#pragma once
#ifndef _CREATURE_H_
#define _CREATURE_H_
#include <cmath>
//写代码
struct Pos{
    int x = 0;
    int y = 0;
};
class Creature {
protected:
    int Id = 0;
    Pos pos;
    int lifeCount = 0;
    double speed = 0;
    int dir_x = 0;
    int dir_y = 0;
    double len_dir = 0;
    bool isAlive = true;
    bool isColliding = false;

    enum creatureType {
        PLAYER,
        PREDATOR,
        PRODUCER,
    };
public:
    Creature(int id, bool is_alive,int x,int y,int life_count,double speed) {
        this->Id = id;
        this->isAlive = is_alive;
        this->pos.x = x;
        this->pos.y = y;
        this->lifeCount = life_count;
        this->speed = speed;
    };
    virtual ~Creature() = default;

    virtual bool CheckCollision() = 0;
    virtual int GetId() = 0;
    virtual void ConsumeLife() = 0;
    virtual creatureType GetCreatureType() = 0;
    virtual Pos GetPos() = 0;
    virtual double SetSpeed(double speed) = 0;
};
#endif
